package cn.e3mall.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.e3mall.common.pojo.EasyUIDataGridResult;
import cn.e3mall.service.ItemService;


@Controller
public class PageController {

	@Autowired
	private ItemService ItemService;
	
	@RequestMapping("/")
	public String demo1(){
		return "index";
	}
	
	@RequestMapping("/{page}")
	public String demo2(@PathVariable String page){
		return page;
	}
	
	@RequestMapping("/item/list")
	@ResponseBody
	public EasyUIDataGridResult getItemList(Integer page,Integer rows){
		EasyUIDataGridResult result = ItemService.getItemList(page, rows);
		return result;
	}
	
}
